package com.tools.goods;


import android.os.Parcel;
import android.os.Parcelable;

public class Goods implements Parcelable {
    private String id; //产品id
    private String goodsCode; //产品编号
    private String goodsName; //产品名称
    private int productDeadline; //产品期限
    private double annualInterestRate; //年化利率
    private int minAmount; //起存金额
    private int increasingAmount; //递增金额
    private int limitForOne; //单人限额
    private int limitForDay; //单人限额
    private int riskGrade; //风险等级
    private String valueDate; //起息日
    private int interestSettlementWay; //结息方式
    private String dueDate; //到期日

    public Goods() {
    }

    public Goods(String id, String goodsCode, String goodsName, int productDeadline, double annualInterestRate, int minAmount, int increasingAmount, int limitForOne, int limitForDay, int riskGrade, String valueDate, int interestSettlementWay, String dueDate) {
        this.id = id;
        this.goodsCode = goodsCode;
        this.goodsName = goodsName;
        this.productDeadline = productDeadline;
        this.annualInterestRate = annualInterestRate;
        this.minAmount = minAmount;
        this.increasingAmount = increasingAmount;
        this.limitForOne = limitForOne;
        this.limitForDay = limitForDay;
        this.riskGrade = riskGrade;
        this.valueDate = valueDate;
        this.interestSettlementWay = interestSettlementWay;
        this.dueDate = dueDate;
    }

    public String getId(){
        return id;
    }

    public void setId(String id){
        this.id = id;
    }

    public String getGoodsCode(){
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode){
        this.goodsCode = goodsCode;
    }

    public String getName() {
        return goodsName;
    }

    public void setName(String goodsName) {
        this.goodsName = goodsName;
    }

    public int getProductDeadline(){
        return productDeadline;
    }

    public void setProductDeadline(int productDeadline){
        this.productDeadline = productDeadline;
    }

    public double getAnnualInterestRate(){
        return annualInterestRate;
    }

    public void setAnnualInterestRate(double annualInterestRate){
        this.annualInterestRate = annualInterestRate;
    }

    public int getMinAmount(){
        return minAmount;
    }

    public void setMinAmount(int minAmount){
        this.minAmount = minAmount;
    }

    public int getIncreasingAmount(){
        return increasingAmount;
    }

    public void setIncreasingAmount(int increasingAmount){
        this.increasingAmount = increasingAmount;
    }

    public int getLimitForOne(){
        return limitForOne;
    }

    public void setLimitForOne(int limitForOne){
        this.limitForOne = limitForOne;
    }

    public int getLimitForDay(){
        return limitForDay;
    }

    public void setLimitForDay(int limitForDay){
        this.limitForDay = limitForDay;
    }

    public int getRiskGrade(){
        return riskGrade;
    }

    public void setRiskGrade(int riskGrade){
        this.riskGrade = riskGrade;
    }

    public String getValueDate(){
        return valueDate;
    }

    public void setValueDate(String valueDate){
        this.valueDate = valueDate;
    }

    public int getInterestSettlementWay(){
        return interestSettlementWay;
    }

    public void setInterestSettlementWay(int interestSettlementWay){
        this.interestSettlementWay = interestSettlementWay;
    }

    public String getDueDate(){
        return dueDate;
    }

    public void setDueDate(String dueDate){
        this.dueDate = dueDate;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(goodsCode);
        dest.writeString(goodsName);
        dest.writeInt(productDeadline);
        dest.writeDouble(annualInterestRate);
        dest.writeInt(minAmount);
        dest.writeInt(increasingAmount);
        dest.writeInt(limitForOne);
        dest.writeInt(limitForDay);
        dest.writeInt(riskGrade);
        dest.writeString(valueDate);
        dest.writeInt(interestSettlementWay);
        dest.writeString(dueDate);
    }

    public static final Parcelable.Creator<Goods> CREATOR = new Parcelable.Creator<Goods>() {
        @Override
        public Goods createFromParcel(Parcel source) {
            //从Parcel中读取数据
            //此处read顺序依据write顺序
            return new Goods(source.readString(),
                             source.readString(),
                             source.readString(),
                             source.readInt(),
                             source.readDouble(),
                             source.readInt(),
                             source.readInt(),
                             source.readInt(),
                             source.readInt(),
                             source.readInt(),
                             source.readString(),
                             source.readInt(),
                             source.readString() );
        }
        @Override
        public Goods[] newArray(int size) {
            return new Goods[size];
        }
    };
}
